#include <iostream>
#include <cstdio>

using namespace std;

class A
{
public:
	virtual void print(void)
	{
		cout<<"A"<<endl;
	}
};

class B : public A
{
public:
	virtual void print(void)
	{
		cout<<"B"<<endl;
	}
};

class C:public A
{
public :
	void print(void)
	{
		cout<<"C"<<endl;
	}
};

void print(A a)
{
	a.print();
}

int main()
{
	A a;
	B b;
	C c;

	print(a);
	print(b);
	print(c);
	return 0;
}
